const login = document.querySelectorAll('i');
const getAuth = document.getElementById('getAuth');
login.forEach(item => {
    item.addEventListener('click', (event) => {

        const login1 = document.getElementById('login1');
        const login2 = document.getElementById('login2');
        login1.style.zIndex = 0;
        login2.style.zIndex = 0;
        if (event.target.id == 'toLogin1') {
            login1.style.zIndex = 1;
            return;
        }
        login2.style.zIndex = 1;
    })
});
let run = null;
getAuth.addEventListener('click', (event) => {
    getAuth.style.pointerEvents = 'none';
    let authTime = document.getElementById('authTime');
    authTime.style.display = 'inline-block';
    let timeStop = 59;
    run = setInterval(() => {
        timeStop--;
        if (timeStop <= 0) {
            clearInterval(run);
            run = null;
            authTime.style.display = 'none';
            getAuth.style.pointerEvents = '';
            return;
        };
        authTime.innerHTML = `(${timeStop})`;
    }, 1000);


})